<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org"
       xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="layout :: htmlhead" th:with="title='用户管理'"></head>
<body class="layui-layout-body">
<style>
    .layui-col-md6 {
        width: 50%;
        padding: 1px;
    }
    .layui-col-md12 {
        width: 100%;
        padding: 1px;
    }
    .tableSelect {
        width:100%;
        border:1px;
    }
    .tableSelectTd{
        width:100%;
        text-align:left;
        height: 28px;
        font-size: 18px;
        padding: 5px  10px 5px 10px;
    }
    .linkTableName{
        color: #1e9fff;
    }
    .linkTableName:hover{
        color: #000000;
    }
    .title{
        font-size: 22px;
        padding-left: 10px;
        display: inline-block;
        width:68%;
        color: #1e9fff;
        height:38px;
        line-height: 38px;
    }
</style>
<div class="layui-layout layui-layout-admin">
    <!--头-->
    <div th:replace="fragments/head :: header"></div>

    <div style="margin: 1% 4% 5% 4%">

        <!--<hr class="layui-bg-blue"/>
        <hr class="layui-bg-black"/>-->
        <div style="width: 100%">
            <div class="title">
                <span>简单代码生成工具</span>
            </div>
            <div style="text-align: right;display: inline-block;width:31%;">
                <button class="layui-btn layui-btn-normal" onclick="addDataSource()">新建数据源</button>
            </div>

        </div>


        <table id="dataSourceList" lay-filter="dataSourceTable"></table>

        <script type="text/html" id="optBar">
             <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="createTableCode">生成代码</a>
             <a class="layui-btn layui-btn-edit layui-btn-xs" lay-event="edit">编辑</a>
             <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="copy">复制</a>
             <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
        </script>
    </div>


    <!--添加或编辑用户-->
    <div id="saveDataSource" class="layer_self_wrap" style="width:910px;display:none;padding-left:15px;">
        <form id="dataSourceForm" class="layui-form layui-form-pane" method="post" action="" style="margin-top: 20px;">
            <input id="pageNum" type="hidden" name="pageNum"/>
            <input id="id" type="hidden" name="id"/>
            <div class="layui-inline layui-col-md12">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input id="txt" name="txt" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                </div>
            </div>
            <div class="layui-inline layui-col-md12">
                <label class="layui-form-label">数据库类型</label>
                <div class="layui-input-block">
                    <select id="dbType" name="dbType" >
                        <option value="mysql">mysql</option>
                        <option value="oracle">oracle</option>
                        <option value="postgres">postgres</option>
                        <option value="sqlserver">sqlserver</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline layui-col-md12">
                <label class="layui-form-label">地址</label>
                <div class="layui-input-block">
                    <input id="url" name="url" lay-verify="required" autocomplete="off" class="layui-input" type="text" />
                </div>
            </div>

            <div class="layui-inline layui-col-md6">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input id="username" name="username" lay-verify="required" autocomplete="off" class="layui-input" type="text" />
                </div>
            </div>
            <div class="layui-inline layui-col-md6">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block">
                    <input id="password" name="password" lay-verify="required" autocomplete="off" class="layui-input" type="text" />
                </div>
            </div>

            <div class="layui-form-item" style="padding-top: 10px;padding-bottom: 10px;">
                <div class="layui-input-block" style="margin-left: 0px;text-align:center">
                    <button class="layui-btn"  lay-submit="" lay-filter="dataSourceSubmit">保 存</button>
                </div>
            </div>
        </form>
    </div>


    <!--选择列表-->
    <div id="selectTable" class="layer_self_wrap" style="width:410px;display:none;padding-left:15px;height: 600px;">
        <form id="selectTableForm" class="layui-form layui-form-pane" method="post" action="" style="margin-top: 5px;">
            <input id="selectId" type="hidden" name="selectId"/>
            <table  lay-filter="selectTableNow" id="selectTableNow" class="tableSelect" border="1px">

            </table>
            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 0px;text-align:center">
                </div>
            </div>
        </form>
    </div>

    <!--底部-->
    <div th:replace="fragments/footer :: footer"></div>
    <script src="/js/system/dataSourceManage.js"></script>

</div>
</body>
</html>